package com.neusoft.elmboot.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.neusoft.elmboot.po.Business;
import com.neusoft.elmboot.po.Credit;
import com.neusoft.elmboot.po.UserCart;

@Mapper
public interface CreditMapper {
	@Insert("insert into credit(credit,type,create_time,expired_time,userId) values(#{credit},#{type},#{create_time},#{expired_time},#{userId})")
	@Options(useGeneratedKeys=true,keyProperty="id",keyColumn="id")
	 public int addByUserId(Credit credit);
	
	@Select("select * from credit where userId=#{userId}")
	 public Credit getByUserId(Credit credit);
	
	@Select("select * from credit where userId=#{userId}")
	public List<Credit> listByUserId(Credit credit);

}
